package example;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

/**
 * @Author: luobiao
 * @Date: 2024/3/9 14:07
 * @Description:
 */
@Schema(description = "desc")
public class User {
    @NotNull(message = "必填参数不能为空")
    @Schema(description = "用户名称")
    private String name;
    @NotNull
    private Integer age;

    public User(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
